import { TFormItemComponent } from "../types/componentTypes.ts";

const GET_CHANGE_VALUE_MAP: Record<TFormItemComponent, (e: any) => any> = {
  input: e => e.target.value,
  inputNumber: e => e,
  select: e => e,
  custom: e => e,
  timePicker: e => e,
  timeRangePicker: e => e,
  loadSelect: e => e,
  radio: e => e,
};

export const getValue = (type: TFormItemComponent, ...args: any[]) => {
  // @ts-ignore
  return GET_CHANGE_VALUE_MAP[type]?.(...args);
};
